package elitech.vietnam.myfashion.dialog;

import android.app.Dialog;
import android.content.Intent;
import android.provider.Settings;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import elitech.vietnam.myfashion.MainActivity;
import elitech.vietnam.myfashion.R;

public class ConnectionErrorDialog extends Dialog implements OnClickListener {
	private MainActivity mContext;
	private Button mBtnOk, mBtnCheck, mBtnExit;
	public ConnectionErrorDialog(MainActivity context) {
		super(context, R.style.Dialog);
		this.mContext = context;
		setContentView(R.layout.connectionerror);
		mBtnOk = (Button) findViewById(R.id.warn_btnOk);
		mBtnCheck= (Button) findViewById(R.id.warn_btnCheck);
		mBtnExit = (Button) findViewById(R.id.warn_btnExit);
		mBtnOk.setOnClickListener(this);
		mBtnCheck.setOnClickListener(this);
		mBtnExit.setOnClickListener(this);
		this.setCancelable(false);
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.warn_btnOk:
			TryAgain();
			this.dismiss();
			break;
		case R.id.warn_btnCheck:
			Intent intent = new Intent(
					Settings.ACTION_WIFI_SETTINGS);
			mContext.startActivity(intent);
			break;
		case R.id.warn_btnExit:
			this.dismiss();
			break;
		}
	}

	public void TryAgain(){
		
	}
	
	@Override
	public void dismiss() {
		mContext.isConnectionErrorShow = false;
		super.dismiss();
	}
	
}

